Part Number Hot Search : 
NTE136A S8450MG C451PB 10T08ACW HA1314 LT1012MH 54HC1 M3006
Product Description
Full Text Search
 

To Download AN1369 Datasheet File

  If you can't view the Datasheet, Please click here to try to view without PDF Reader .  
 
 


  Datasheet File OCR Text:
  AN1369/0901 1/23 AN1369 application note getting started with raisonance ide for the st6 microcontroller by microcontroller division applications introduction ride is the development toolchain for st62 developed by raisonance. this fully integrated development environment supports all the st62 microcontroller family and features a pow- erful macro-assembler, a linker, a c compiler and a state-of-the-art simulator and debugger. it can drive the st6-hds2, ceibo eb-st62 and softec ds6225a & ds6265a emulators. you can install the evaluation version from either the amcu on cdo cd-rom or directly from the raisonance website: http://www.raisonance.com . this tutorial has been extracted from the user manual of the st6 evaluation board, st6-eval, available on either the amcu on cdo cd-rom or on the st mcu website http://mcu.st.com . for more information about raisonance ide, please contact raisonance at http://www.rai- sonance.com and to get other program examples, please refer to the st6 evaluation board manual. note: the corresponding source files are provided in a downloadable .zip file along with this note on the st mcu website http://mcu.st.com the goal of this application note is to help you get started with the raisonance ide environ- ment using an example program tutorial.st6 located in the directory .\exercises\tutorial . the exercise will make you familiar with the project management, the assembler syntax and debugging using the raisonance ide. the aim of the tutorial.st6 program is to make two leds blink at a frequency of 1hz, simply using the i/o ports. it assumes that the leds are connected to port pa0 and pa1 of the st6265c device and are active low. 1
2/23 table of contents 23 1projectsetup ...................................... ......... 3 2 editing the code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ................ 5 3compilingthecode .......................................... 6 4 starting a debug session . . . . . . . . . . . . . . . . .................... 7 4.1 steppingthroughthecode .............................. 9 4.2 running the code . . . . . . . . . . . . . . . . . . . . . . . . . . .............. 9 4.3 setting a breakpoint . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10 4.4 watching a variable . . .................................. 10 4.5 viewing the peripherals or the st6 registers . . . . . . . . . . 12 4.6 timefeature ............................................ 13 4.7 advancedfeatures ..................................... 14 4.7.1 trace window . . . . . . . . .................................. 14 4.7.2refreshfeature ........................................ 16 4.7.3animatemode ......................................... 18 4.7.4 disassembly code window . . . . . . . . . . . . . . . . ................ 19 4.7.5 external interrupt window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20 5 enabling ast6/lst6 ride compatibility . . . . . . . . ............... 21 2
3/23 getting started with raisonance ide for the st6 microcontroller 1 project setup 1. start the raisonance ide: from the windows start menu, select start > programs > rai- sonance kit 6.1> ride ide . 2. now you need to create a new project environment. the project file stores all the parame- ters of the project: settings, options, and all the files that have to be included to the project. to create a new project, go to the project menu and click on new . the dialog box shown in figure 1 will appear. figure 1. new project dialog box 3. click on browse to find the path where you want to create your project and name it (e.g. tutorial.prj). click on the ok button to validate the creation of the project. 4. now you have a new window ( project >debugger ) with the name of your new project. click on it with the right mouse button. a menu shown in figure 2 will be displayed.
4/23 getting started with raisonance ide for the st6 microcontroller figure 2. new project menu 5. click on add node source/application (or find it in the project menu) to add the file you want to work on. choose the tutorial.st6 assembly file located int the .\exercises\tutorial . when you select this file, it will display the file code and you will also be able to see it in the project window as shown below. figure 3. project tree 6. you have to specify the target option before compiling any program. this defines the microcontroller used to run the program. click on the options > target menu and choose the microcontroler you are working with (the st6265c in this case). click ok to validate the selection.
5/23 getting started with raisonance ide for the st6 microcontroller figure 4. type of project dialog box now the project environment is set up and you can start playing with the code. 2 editing the code you can now start correcting the file! you will have to fill in the blanks next to the question marks. before you start work, here is a brief explanation of the toolbar. figure 5. editing toolbar this is a list of the actions invoked by each toolbar icon from left to right: open a file in the editor note: be aware that this only opens a file. it doesn't open a project (to do that you have to se- lect project > open ) and it doesn't add the file to the project automatically (to do that you have to select project > add node source/application ). save the changes you made to your file tile the windows vertically enter debug mode compile ( translate ) the single file that is activated or the one that is selected in the project view window. compile ( make all ) all the files of the project (recommended)
6/23 getting started with raisonance ide for the st6 microcontroller undo command cut command copy command paste command find an expression in the file find the next same expression 3 compiling the code a good way to get familiar with ride is to start compiling your program before making any cor- rections and, then, to correct the errors little by little. 1. click on the make all icon to compile the assembly file. a new window will now appear like that shown in figure 6. this window shows you the errors and the warnings the compiler generated and displays the results of the compilation. figure 6. errors and warnings in the make window 2. double-click on the warning or error messages to see the line of the program related to the message. the corresponding line in the program window will be highlighted. 3. start correcting the errors. once you have finished, you can save your changes by clicking on the save icon or on the menu file >save . compile the file again until you made the right corrections, that is to say when no error messages appear anymore. figure 7 shows the window you will get at this point.
7/23 getting started with raisonance ide for the st6 microcontroller figure 7. successful make window 4 starting a debug session in the last section the only thing we did was to compile, i.e. to make sure the program had the right syntax and the right structure. we now have to check if it really does what we want it to do. this is the debug phase. this will be done by using the raisonance simulator to simulate the behaviour of the microcontroller. 1. click on the debug icon to enter debug mode. the following dialog box will appear: figure 8. debug options dialog box when you click on options > debug you can select the type of debug you want to do. select virtual machine (simulator) then sim-st6 and click on the ok button.
8/23 getting started with raisonance ide for the st6 microcontroller figure 9. simulator environment in this environment you have several tools to help you to simulate and view what the program does. let's have a look at the debug toolbar: figure 10. debug toolbar here is a list of the actions invoked by the toolbar icons from left to right: enable animated mode display executed lines. each line containing an instruction in the program is indicated with a green dot. if you press this icon, the green dot next to the executed line becomes blue. refresh command.
9/23 getting started with raisonance ide for the st6 microcontroller reset command. this button corresponds exactly to a hardware reset. execute each line and each function routine step by step ( step into ). execute each line step by step ( step over ). add the watch window . add a toggle breakpoint at the selected line of the program. click again to disable the breakpoint. add a toggle trace at the selected line of the program. click again to disable the toggle trace. select the file you want to debug. run the application. if animated mode is selected, it runs the application at a set speed that can be selected with the next icon. otherwise it runs the application in real-time. set the execution speed of the application in animated mode. 4.1 stepping through the code execute the program step by step using the step over icon. each time you click on this icon you will see the current line changing to the next program instruction. at each step you are then able to look at the state of the microcontroller, as explained later on. note: the step into icon allows you to enter the function subroutines. it is not likely that you will need this feature at the beginning. furthermore this is a rather tedious way of following the execution of the program, because you really step through all the functions. 4.2 running the code you can also run the program directly using the run icon. click once on the icon: it will run the application and the icon will change to click on the icon again and the application is stopped. note at the bottom of the debug window the period of time spent running the application.
10/23 getting started with raisonance ide for the st6 microcontroller 4.3 setting a breakpoint restart the program by selecting the debug >restart menu. click on the vertical bar on the left side of the program window in front of the line where you want to place the breakpoint. the line will be highlighted in red and the next time you run the application, the program counter (pc) will stop at the breakpoint. figure 11. set breakpoint to delete the breakpoint simply click on the red s sign again. 4.4 watching a variable click on debug >add watch . a dialog box will appear: it allows you to select the registers, la- bels or variables you want to watch from a list of expressions. type pa.0 and click on the ok button. figure 12. add watch dialog box
11/23 getting started with raisonance ide for the st6 microcontroller then the following window will appear. it stores all the expressions you need. figure 13. watch window now click with the right button of your mouse on the watch window and select add .this opens the add watch dialog box again. type pa.1 and click on the ok button. figure 14. watch window
12/23 getting started with raisonance ide for the st6 microcontroller 4.5 viewing the peripherals or the st6 registers in the debugger window you can see all the microcontroller's registers and peripherals. figure 15. debugger window double-click on any of the items and you will be able to view their state at any time during de- bugging. figure 16 shows the window that will be displayed when you double-click on the pa icon.
13/23 getting started with raisonance ide for the st6 microcontroller figure 16. port a window figure 17 shows the window that will be displayed when you double-click on the main regis- ters icon. figure 17. main registers window to watch the values of certain registers only, the address of the labels or the value of the pos- sible variables, you have to open the watch window. 4.6 time feature if you want to determine the time spent for one or several instructions of your program, set breakpoints at the first and last instruction. run your program with the run icon. it will stop at the first breakpoint. then select the debug > reset time menu (you can also use the macro ctrl + t ). the displayed time is reset. if you click on the run icon again, it will display the time spent executing the instructions.
14/23 getting started with raisonance ide for the st6 microcontroller 4.7 advanced features 4.7.1 trace window an easy way to see how the program is executed is to trace the state of the pa0 and pa1 ports. you should be able to see the value toggling from 1 to 0 and 0 to 1 every 0.5s. keep the watch window open, select pa.0 and click on the right mouse button. the following menu will appear: figure 18. add/delete from trace list select the add/delete from trace list item and a blue ato will be displayed in front of pa.0. this will allow you to watch the trace of the pa0 pin (you can do the same for pa1) in the trace window. figure 19. pa0 and pa1 toggle trace then select the view >trace >options menu to set the trace options dialog box. then click on the on changes radio button. the trace will be updated each time the value of the se- lected item is changed.
15/23 getting started with raisonance ide for the st6 microcontroller you can also change the maximum number of records that can be displayed in the trace window. validate the choice with the ok button. figure 20. trace options dialog box click now on the view >trace >view menu to open the trace window.
16/23 getting started with raisonance ide for the st6 microcontroller figure 21. trace window 4.7.2 refresh feature now insert a refresh tag so the window will be refreshed each time the instruction, where it is placed, is processed. place it at the program line where the atoggleo label is located so that the trace will be regenerated at each commutation of the pin. to do this, click on the source code line containing the otoggleo label (so that the cursor blinks), and click on the left margin with the right mouse button. the following menu on the next page appears.
17/23 getting started with raisonance ide for the st6 microcontroller figure 22. left margin menu select toggle flag >toggle refresh and a small light bulb icon will appear in front of the line as follows: figure 23. toggle refresh mark at this point, you may want to resize the windows in the screen to have a clear view if what happens when you run the application. you can use the tile vertical icon for example. now, click on the run icon and watch the program working! figure 24 on the next page shows an example of the debug screen you can have.
18/23 getting started with raisonance ide for the st6 microcontroller figure 24. debug overview 4.7.3 animate mode finally, you can run the program using animated mode . this mode allows you to see the pro- gram execute at a desired speed. to do this, click on the animated mode icon and then click on the run icon. you should be able to see the pc running through the program. to set the speed faster or slower, use the speed slider, and drag the index to the desired position on the scale.
19/23 getting started with raisonance ide for the st6 microcontroller 4.7.4 disassembly code window you can open the disassembly code window by selecting the corresponding icon in the project > debugger window. figure 25. disassembly code window you can then check the code at each address of the program memory area. each line of the program is displayed with its address, the label if applicable ( symbol ), the op-code actually executed ( mnemonic ), and the number of times the pc executed the line.
20/23 getting started with raisonance ide for the st6 microcontroller 4.7.5 external interrupt window you get the interrupt controller window after selecting the corresponding icon in the project - debugger window. figure 26. interrupt controller window this window enables you to check whether each interrupt is enabled or not. now it's up to you if you want to make changes to the program (e.g. change the value of counter to modify the delay) or to test the different features of ride. to exit debug mode and return to edit mode, select the debug >terminate menu.
21/23 getting started with raisonance ide for the st6 microcontroller 5 enabling ast6/lst6 ride compatibility ride is able to process ast6/lst6 files. if you want to use them, select options >project and the following dialog box will appear. figure 27. project options dialog box then, double-click on mast6 > source and check the useast6syntax check box: as shown on the next page.
22/23 getting started with raisonance ide for the st6 microcontroller figure 28. project options dialog box this option allows you to assemble files written for the stmicroelectronics ast6 assembler and lst6 linker. a preprocessor will automatically be called to translate the ast6-like direc- tives in ma-st6-like directives.
23/23 getting started with raisonance ide for the st6 microcontroller athe present note which is for guidance only aims at providing customers with information regarding their products in order for them to save time. as a result, stmicroelectronics shall not be held liable for any direct, indirect or consequential damages with respect to any claims arising from the content of such a note and/or the use made by customers of the information contained herein in connexion with their products.o information furnished is believed to be accurate and reliable. however, stmicroelectronics assumes no responsibility for the consequences of use of such information nor for any infringement of patents or other rights of third parties which may result from its use. no license is granted by implication or otherwise under any patent or patent rights of stmicroelectronics. specifications mentioned in this publication are subject to change without notice. this publication supersedes and replaces all information previously supplied. stmicroelectronics products are not authorized for use as critical components in life support devices or systems without the express written approval of stmicroelectronics. the st logo is a registered trademark of stmicroelectronics ? 2001 stmicroelectronics - all rights reserved. purchase of i 2 c components by stmicroelectronics conveys a license under the philips i 2 c patent. rights to use these components in an i 2 c system is granted provided that the system conforms to the i 2 c standard specification as defined by philips. stmicroelectronics group of companies australia - brazil - china - finland - france - germany - hong kong - india - italy - japan - malaysia - malta - morocco - singapore - spain sweden - switzerland - united kingdom - u.s.a. http:// www.st.com


▲Up To Search▲   

 
Price & Availability of AN1369

All Rights Reserved © IC-ON-LINE 2003 - 2022  

[Add Bookmark] [Contact Us] [Link exchange] [Privacy policy]
Mirror Sites :  [www.datasheet.hk]   [www.maxim4u.com]  [www.ic-on-line.cn] [www.ic-on-line.com] [www.ic-on-line.net] [www.alldatasheet.com.cn] [www.gdcy.com]  [www.gdcy.net]


 . . . . .
  We use cookies to deliver the best possible web experience and assist with our advertising efforts. By continuing to use this site, you consent to the use of cookies. For more information on cookies, please take a look at our Privacy Policy. X